	# makefile for AGA-V1
      #
      # Copyright (c) 2011 Ary Rodriguez and Alejandro Esquivel
      #
      # This file is part of AGA-V1.
      #
      # AGA-V1 is free software; you can redistribute it and/or modify
      # it under the terms of the GNU General Public License as published by
      # the Free Software Foundation; either version 3 of the License, or
      # (at your option) any later version.
      #
      # This program is distributed in the hope that it will be useful,
      # but WITHOUT ANY WARRANTY; without even the implied warranty of
      # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
      # GNU General Public License for more details.
      #
      # You should have received a copy of the GNU General Public License
      # along with this program.  If not, see http://www.gnu.org/licenses/.
      #=======================================================================
      #---------------------------------------------------
      #   MPI paralalelization (Y/N)?
      MPIP = N
      #   OpenMP paralalelization (Y/N)?
      #   This is experimental only
      OMP = N
      #---------------------------------------------------
      OBJECTS = extfunc.o modules.o aga-v1.o main.o
      #---------------------------------------------------
      #  mame of the program
      PROGRAM=agav1
      #
      #   enter f90 compiler
      #COMPILER=g77
      #COMPILER=ifort 
       COMPILER=mpif90
      #COMPILER=gcc
      #
      #   compiler options
      FLAGS=-O3 -cpp #-vec-report0 -r8
      #---------------------------------------------------
      ifeq ($(MPIP),Y)
      FLAGS += -DMPIP
      COMPILER=mpif90
      endif
      ifeq ($(OMP),Y)
      FLAGS += -openmp
      endif
      $(PROGRAM)  : ${OBJECTS}
	$(COMPILER) $(FLAGS) -o $@ $(OBJECTS)
 
      %.o:%.f90
	$(COMPILER) $(FLAGS) -c $^ -o $@
      %.o:%.f
	$(COMPILER) $(FLAGS) -c $^ -o $@
      
      .PHONY : clean
      clean :
	rm -f *.o *.mod 
	rm -f $(PROGRAM)
